package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;

import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputPattern;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.en.RepaymentType;
import com.hengpeng.itfinbase.idAssign.AbstractAssign18IdEntity;

/**
 * <pre>
 * 债权转让记录表
 * </pre>
 * @author weiyuan
 * @version 1.0, 2015年7月24日
 */
@Entity
public class CreditAssign extends AbstractAssign18IdEntity
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 7930981157780404593L;

	/**
	 * <pre>
	 * 转让状态
	 * </pre>
	 */
	public enum AssignStatus
	{
		PUBLISHED("转让已发布"),

		ASSIGNING("转让中"),

		ASSIGNSUCCESS("转让成功"),

		ASSIGNFAIL("转让失败");

		private String text;

		AssignStatus(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	/**
	 * 借款标的id
	 */
	@Column(length = 50)
	@HtmlInput(label = "借款标的id", type = HtmlInputType.TEXT, nullable = true, index = 1)
	private Long borrowInfoId;

	/**
	 * 标的名称
	 */
	@Column(length = 50)
	@HtmlInput(label = "标的名称", type = HtmlInputType.TEXT, nullable = true, index = 3)
	private String borrowName;

	/**
	 * 年化利率
	 */
	@HtmlInput(label = "年化利率", type = HtmlInputType.TEXT, index = 5, pattern = HtmlInputPattern.FLOAT, nullable = false)
	private Double borrowRate;

	/**
	 * 借款金额，单位：分
	 */
	@HtmlInput(label = "借款金额(分)", type = HtmlInputType.TEXT, index = 4, pattern = HtmlInputPattern.INT, nullable = false)
	private Long borrowMoney;

	/**
	 * 还款方式
	 */
	@Column(length = 25)
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "还款方式", type = HtmlInputType.SELECT, labelProperty = "text", index = 3)
	private RepaymentType repaymentType;

	/**
	 * 被转让的投标信息id
	 */
	@Column(length = 50)
	@HtmlInput(label = "被转让的投标信息id", type = HtmlInputType.TEXT, nullable = true, index = 1)
	private Long investInfoId;

	/**
	 * 投标金额，单位：分
	 */
	@HtmlInput(label = "原投标金额(分)", type = HtmlInputType.TEXT, index = 4, pattern = HtmlInputPattern.INT, nullable = false)
	private Long investMoney;

	/**
	 * 转让人id
	 */
	@Column(length = 50)
	@HtmlInput(label = "转让人id", type = HtmlInputType.TEXT, nullable = true, index = 2)
	private Long sellUserId;

	/**
	 * 转让人托管账户id
	 */
	@Column(length = 50)
	@HtmlInput(label = "转让人托管账户id", type = HtmlInputType.TEXT, nullable = true, index = 3)
	private String sellTrustAccountId;

	/**
	 * 可转让金额(分)
	 */
	@Column(length = 50)
	@HtmlInput(label = "可转让金额(分)", type = HtmlInputType.TEXT, nullable = true, index = 4)
	private Long sellMoney;

	/**
	 * 剩余期数
	 */
	@Column(length = 50)
	@HtmlInput(label = "剩余期数", type = HtmlInputType.TEXT, nullable = true, index = 4)
	private Long leftPlanNum;

	@Column(length = 50)
	@HtmlInput(label = "剩余本息", type = HtmlInputType.TEXT, nullable = true, index = 4)
	private Long leftMoney;

	/**
	 * 承接人id
	 */
	@Column(length = 50)
	@HtmlInput(label = "承接人id", type = HtmlInputType.TEXT, nullable = true, index = 5)
	private Long buyUserId;

	/**
	 * 承接人托管账户id
	 */
	@Column(length = 50)
	@HtmlInput(label = "承接人托管账户id", type = HtmlInputType.TEXT, nullable = true, index = 6)
	private String buyTrustAccountId;

	/**
	 * 承接人付给转让人的金额：购买价格
	 */
	@Column(length = 50)
	@HtmlInput(label = "承接人付给转让人的金额", type = HtmlInputType.TEXT, nullable = true, index = 7)
	private Long buyMoney;

	/**
	 * 转让状态
	 */
	@Column(length = 50)
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "转让状态", type = HtmlInputType.TEXT, nullable = true, index = 8)
	private AssignStatus status;

	/**
	 * 已还金额
	 */
	@Column(length = 50)
	@HtmlInput(label = "已还金额(分)", type = HtmlInputType.TEXT, nullable = true, index = 9)
	private Long repaymentedMoney;

	/**
	 * 手续费
	 */
	@Column(length = 50)
	@HtmlInput(label = "手续费(分)", type = HtmlInputType.TEXT, nullable = true, index = 10)
	private Long feeMoney;

	/**
	 * 认购期限
	 */
	@HtmlInput(label = "认购期限", type = HtmlInputType.TEXT, index = 7, pattern = HtmlInputPattern.INT, nullable = false)
	private Integer assignDuration;

	/**
	 * 创建时间
	 */
	@HtmlInput(label = "创建时间", maxLength = 50, type = HtmlInputType.TEXT, index = 1, nullable = false)
	private Date createTime;

	/**
	 * 更新时间
	 */
	@HtmlInput(label = "更新时间", maxLength = 50, type = HtmlInputType.TEXT, index = 1, nullable = false)
	private Date updateTime;

	/**
	 * 转让成功时间
	 */
	@HtmlInput(label = "转让成功时间", maxLength = 50, type = HtmlInputType.TEXT, index = 1, nullable = false)
	private Date assignSuccessTime;

	public Long getLeftMoney()
	{
		return leftMoney;
	}

	public void setLeftMoney(Long leftMoney)
	{
		this.leftMoney = leftMoney;
	}

	public Long getInvestMoney()
	{
		return investMoney;
	}

	public void setInvestMoney(Long investMoney)
	{
		this.investMoney = investMoney;
	}

	public Date getAssignSuccessTime()
	{
		return assignSuccessTime;
	}

	public void setAssignSuccessTime(Date assignSuccessTime)
	{
		this.assignSuccessTime = assignSuccessTime;
	}

	public Integer getAssignDuration()
	{
		return assignDuration;
	}

	public void setAssignDuration(Integer assignDuration)
	{
		this.assignDuration = assignDuration;
	}

	public Long getLeftPlanNum()
	{
		return leftPlanNum;
	}

	public void setLeftPlanNum(Long leftPlanNum)
	{
		this.leftPlanNum = leftPlanNum;
	}

	public Long getBorrowMoney()
	{
		return borrowMoney;
	}

	public void setBorrowMoney(Long borrowMoney)
	{
		this.borrowMoney = borrowMoney;
	}

	public Long getBorrowInfoId()
	{
		return borrowInfoId;
	}

	public void setBorrowInfoId(Long borrowInfoId)
	{
		this.borrowInfoId = borrowInfoId;
	}

	public String getBorrowName()
	{
		return borrowName;
	}

	public void setBorrowName(String borrowName)
	{
		this.borrowName = borrowName;
	}

	public Double getBorrowRate()
	{
		return borrowRate;
	}

	public void setBorrowRate(Double borrowRate)
	{
		this.borrowRate = borrowRate;
	}

	public RepaymentType getRepaymentType()
	{
		return repaymentType;
	}

	public void setRepaymentType(RepaymentType repaymentType)
	{
		this.repaymentType = repaymentType;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Long getInvestInfoId()
	{
		return investInfoId;
	}

	public void setInvestInfoId(Long investInfoId)
	{
		this.investInfoId = investInfoId;
	}

	public Long getSellUserId()
	{
		return sellUserId;
	}

	public void setSellUserId(Long sellUserId)
	{
		this.sellUserId = sellUserId;
	}

	public String getSellTrustAccountId()
	{
		return sellTrustAccountId;
	}

	public void setSellTrustAccountId(String sellTrustAccountId)
	{
		this.sellTrustAccountId = sellTrustAccountId;
	}

	public Long getSellMoney()
	{
		return sellMoney;
	}

	public void setSellMoney(Long sellMoney)
	{
		this.sellMoney = sellMoney;
	}

	public Long getBuyUserId()
	{
		return buyUserId;
	}

	public void setBuyUserId(Long buyUserId)
	{
		this.buyUserId = buyUserId;
	}

	public String getBuyTrustAccountId()
	{
		return buyTrustAccountId;
	}

	public void setBuyTrustAccountId(String buyTrustAccountId)
	{
		this.buyTrustAccountId = buyTrustAccountId;
	}

	public Long getBuyMoney()
	{
		return buyMoney;
	}

	public void setBuyMoney(Long buyMoney)
	{
		this.buyMoney = buyMoney;
	}

	public AssignStatus getStatus()
	{
		return status;
	}

	public void setStatus(AssignStatus status)
	{
		this.status = status;
	}

	public Long getRepaymentedMoney()
	{
		return repaymentedMoney;
	}

	public void setRepaymentedMoney(Long repaymentedMoney)
	{
		this.repaymentedMoney = repaymentedMoney;
	}

	public Long getFeeMoney()
	{
		return feeMoney;
	}

	public void setFeeMoney(Long feeMoney)
	{
		this.feeMoney = feeMoney;
	}
}
